package my.storm.camel;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringApplicationFactory {

	private static ApplicationContext applicationContext;
	private static final String CONTEXT_CONFIG = "classpath*:spring/*.xml";
	
	public static ApplicationContext getContext() {
		
		if(applicationContext == null) {
			synchronized(ApplicationContext.class) {
				applicationContext = new ClassPathXmlApplicationContext(CONTEXT_CONFIG);
			}
		}
		return applicationContext;
	}
}
